library('knitr')
knitr::opts_chunk$set(cache=TRUE)
opts_chunk$set(fig.path = "/Users/sarahurbut/Dropbox/PaperEdits/Paper/Figures/")
testes.spec=which(rowSums(pm.beta.norm[,-40]<0.5)==43&(rowSums(lfsr[,1:44]<0.05)>=40))[1:10]
newfunc.2(1040)
Here are examples of uk5
Lastly, the inclusion of the eQTLBMA lite configurations (in which the SNP has a non-zero effect in only one tissue) coupled with the learned patterns of tissue specificity evident in matrices Uk : 5 − 9 serve to allow the preservation of qualitatively specific effects. Here, we show a gene-snp pair demonstrating strong posterior probability from arising from one of the eQTL-bma lite configs. Accordingly we reject the significance of the effect size estimates in all tissues but testes, a pattern consistent with the presence of tissue-specificity described below. Together, these results cement the resolution afforded by methods which can distinguish among tissues in which a QTL is called active, beyond reducing genetic effects to binary ‘on’ or ‘off’ conclusions.
Good example for whole bllood with decent rpkm across the board:
newfunc.2(wholebloodfour)
To plot the PC:
pi.mash=readRDS("~/gtexresults_matrixash//Data/pisAug13withED.rds")$pihat
abr.names=read.table("~/gtexresults_matrixash/Data/abbreviate.names.txt")
#pi.mash=readRDS("~/Dropbox/withzero/piswithzero.rds")$pihat[-1189]
pi.mat.mash=matrix(data = pi.mash,nrow = 22,ncol =54,byrow = TRUE)
par(mfrow=c(3,3))
par(mar=c(4,3,2,1))
for(i in 2:9){
v=svd(covmat[[i]])$v
colnames(v)=rownames(v)=abr.names[,2]
max.effect=sign(v[,1][which.max(abs(v[,1]))])
barplot(max.effect*v[,1],las=2,main=paste0("EigenVector1ofUk=",i),#main=ifelse(i!=5,paste0("EigenVector1ofUk=",i),""),ylab=ifelse(i==5,paste0("EigenVector1ofUk=",i),""),
col=i-1,axisnames=ifelse(i==2,TRUE,FALSE),cex.names=ifelse(i==2,0.4,NULL))
#if(i==5) { mtext(paste0("EigenVector1ofUk=",i))}
}
barplot(rep(1,44),main="Consistent Config, mash.lite")
significantUK=order(colSums(pi.mat.mash),decreasing = T)[1:6]
par(mfrow=c(1,1))
#par(mfrow=c(2,3))
#par(mar=c(4,3,2,1))
for(i in significantUK){
v=svd(covmat[[i]])$v
colnames(v)=rownames(v)=abr.names[,2]
max.effect=sign(v[,1][which.max(abs(v[,1]))])
barplot(max.effect*v[,1],las=2,main=paste0("EigenVector1ofUk=",i,",pihat=",round(colSums(pi.mat.mash)[i],2)),#main=ifelse(i!=5,paste0("EigenVector1ofUk=",i),""),ylab=ifelse(i==5,paste0("EigenVector1ofUk=",i),""),
col=i-1,axisnames=ifelse(i==2,TRUE,FALSE),cex.names=ifelse(i==2,0.4,NULL))
#if(i==5) { mtext(paste0("EigenVector1ofUk=",i))}
}
#barplot(rep(1,44),main="Consistent Config, mash.lite")